/*
	This file is part of GTimer.

    GTimer is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License\.

    GTimer is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with GTimer. If not, see <http://www.gnu.org/licenses/>.
	
	Copyright 2012 Muhammad Ghareeb Sideek
	Contact: MGhareeb64@gmail.com
 */

package com.gsourcecode.utils;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;

public class Samples {

	public static boolean flood(File root) {
		try {
			// AERO
			String aero = "";
			aero += "00 02 00 #0000FF \"5_Walk\"\n";
			aero += "LOOP 4\n";
			aero += "00 01 00 #3300CC \"6_Jog\"\n";
			aero += "00 01 00 #660099 \"7_Jog forward\"\n";
			aero += "00 01 00 #990066 \"8_Run\"\n";
			aero += "00 01 00 #CC0033 \"9_Faster\"\n";
			aero += "POOL\n";
			aero += "00 01 00 #FF0000 \"10_Sprint!\"\n";
			aero += "00 01 00 #0000FF \"5_Walk\"\n";
			writeSampleFile(root, "bfl_aero", aero);
			// UPPER
			String upper = "";
			upper += "00 09 00 #0000FF \"Chest\"\n";
			upper += "00 09 00 #008888 \"Shoulder\"\n";
			upper += "00 09 00 #00FF00 \"Back\"\n";
			upper += "00 09 00 #888800 \"Bicep\"\n";
			upper += "00 09 00 #FF0000 \"Tricep\"\n";
			writeSampleFile(root, "bfl_upper", upper);
			// LOWER
			String lower = "";
			lower += "00 10 00 #0000FF \"Quads\"\n";
			lower += "00 10 00 #008888 \"Hamstrings\"\n";
			lower += "00 10 00 #00FF00 \"Calves\"\n";
			lower += "00 12 00 #888800 \"Abdominals\"\n";
			writeSampleFile(root, "bfl_lower", lower);
			// STOPWATCH
			String stopwatch = "";
			stopwatch += "9999 99 99 #222222 \"Go!\"\n";
			writeSampleFile(root, "stopwatch", stopwatch);
			// COLORS
			String colors = "";
			colors += "00 00 02 #222222 \"Hex colors_demo\"\n";
			colors += "00 00 02 #FF0000 \"Red\"\n";
			colors += "00 00 02 #FFFF00 \"Yellow\"\n";
			colors += "00 00 02 #00FF00 \"Green\"\n";
			colors += "00 00 02 #00FFFF \"Cyan\"\n";
			colors += "00 00 02 #0000FF \"Blue\"\n";
			writeSampleFile(root, "demo_colors", colors);
		} catch (IOException e) {}
		return true;
	}

	private static void writeSampleFile(File root, String fName, String content) throws IOException {
		File f = new File(root.getAbsolutePath() + File.separator + fName + ".txt");
		f.createNewFile();
		PrintWriter out = new PrintWriter(f);
		out.write(content);
		out.close();
	}

}
